/*
visqrt
Copyright (C) 2010  Bhupendra Aole

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
*/
/*
 * File: PluginManager.java
 * Author: Bhupendra Aole
 * Date: Aug 31, 2010: 
 * 
 * Revisions:
 * ----------
 */

package aole.plugin;

import java.util.HashMap;

public class PluginManager {
	private static HashMap<String, VQPlugin> hm;

	public static void loadPlugins (VQScene scene) {
		hm = new HashMap<String, VQPlugin>();

		// every plugin will provide, keywords with which to identify it.
		// eg. "sphere" keyword in scene file will return STDPlugin.
		STDPlugin stdp = new STDPlugin();
		stdp.init(scene);
		String k[] = stdp.getKeywords();
		for (int i = 0; i < k.length; i++)
			hm.put(k[i], stdp);
	}

	public static VQPlugin getPlugin (String keyword) {
		return hm.get(keyword);
	}
}
